package com.aiti.lulian.utils;

import cn.hutool.core.exceptions.ExceptionUtil;
import lombok.extern.slf4j.Slf4j;

import javax.servlet.http.HttpServletResponse;

@Slf4j
public class ResponseUtil {

    public static void sendJsonString(HttpServletResponse response, String jsonString) {
        try {
            response.setContentType("application/json;charset=utf-8");
            response.getWriter().write(jsonString);
        } catch (Exception e) {
            log.error("发送json字符串异常：{}", ExceptionUtil.stacktraceToString(e));
        }
    }
}
